Repository navigation
Conversation
Registering, deleting and rescheduling tests (test_registry) and pprof (pprof) now need an explicit assertoor:<feature> grant in the token's services claim. Tokens without the claim, minted by an authenticatoor without grants, keep every feature. Bumps service-authenticatoor to main (b69364b, #17) for the feature evaluation.
There was a problem hiding this comment.
This PR adds per-login feature grants for test-definition endpoints and pprof, with a compatibility fallback for tokens lacking a services claim, tests using real issuer/verifier flows, regenerated Swagger docs, and a service-authenticatoor bump. I traced the gated handlers, the feature decision in the new library version, and the pprof path; I found no functional or security defect in the change.
Reviewed 17 changed file(s) @ 0c8199a4 — no blocking issues found.
"Good enough is good enough."
Scheduling, cancelling and deleting test runs, editing the dashboard config and starting AI chats now need assertoor:write. Lets a devnet grant every panda user read access (assertoor) while writes stay with staff (assertoor:all / all:all). Tokens without a services claim are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
With service-authenticatoor#17, a devnet's authenticatoor can issue grants per login, so access can be wider than "everyone behind Cloudflare Access" (ansible-collection-general#598 wires this up for devnets). assertoor already checks the service itself (
servicesclaim must allowassertoor). It cannot yet tell basic use apart from the operations that should stay with operators: test definitions can run shell tasks, so registering one is code execution on the assertoor pod.What
Basic access becomes read-only. Three features, granted per login as
assertoor:<feature>(orassertoor:all), each needing an explicit grant (the library's default-deny mode):writePOST /api/v1/test_runs/schedule(and legacyPOST /api/v1/test_run),POST /api/v1/test_runs/delete,POST /api/v1/test_run/{runId}/cancel,PUT /api/v1/dashboard_config,POST /api/v1/ai/chattest_registryPOST /api/v1/tests/register,POST /api/v1/tests/register_external,POST /api/v1/tests/delete,PUT /api/v1/test/{testId}/schedulepprof/debug/pprof/*Everything else (tests, runs, results, logs, task details, AI sessions and usage) needs basic
assertooraccess only. This lets a devnet give every panda user read access with a bareassertoorgrant while writes stay with staff.A login without the feature gets 403 with
forbidden: this login lacks the assertoor feature <name>. Swagger docs regenerated (401/403 on the gated endpoints).Example grant (authenticatoor
grants):Compatibility
servicesclaim keeps every feature. An authenticatoor without agrantssection mints no claim, and one with grants never mints an empty one, so devnets that have not enabled grants behave exactly as before.authProviderUrl) stays fully open.service-authenticatooris bumped from v0.0.2 to main at b69364b (the Add task that requests funds from the shadowfork vault #17 merge) forClaims.HasFeature. This should become v0.0.4 once that is tagged; marking the PR draft until then.Not in this PR
hasFeaturecould drive that later.POST /api/v1/ai/validatehas no auth today and only validates YAML; left as is.Testing
pkg/web/auth: tokens signed by a real authenticatoor issuer (pkg/issuer) and checked through the real verifier: no claim,+all,+all:all,-all,+assertoor,-all,+assertoor,+assertoor:write,-all,+assertoor,+assertoor:test_registry,assertoor:all,assertoor:all:-pprof,-all,+faucet,+faucet:drop_100eth(refused by the service gate),-all, and open mode. Switching the check to default-allow makes three cases fail, so the table tests the mode. Each case also checksFeatureStatus(200/401/403) for a write request; open mode and a nil handler answer 200.pkg/web: pprof returns 403 for a login without the feature (header and browser cookie), existing cases unchanged.go build ./...,go vet,go test ./... -raceonpkg/web/..., fullgo test ./...pass.golangci-lint run --new-from-rev origin/master ./...(2.14) reports 0 issues.